<template>
  {{ msg }}
  <home></home>
  <personal></personal>
</template>

<script>
export default {
  name: "index",
  components: {
    home: {
      template:"<div><div>{{msg}}</div><button @click='switchTab' class='button'>点击出现layer</button></div>",
      data() {
        return {
          msg:"my name is home",
          btnId:1
        }
      },
      methods: {
        switchTab(){
          this.btnId++;
          alert(this.btnId)
        }
      },
      created:function() {
        this.btnId = 1000;
      }
    },
    personal: httpVueLoader('./template/components/personal.vue'),
  },
  data() {
    return {
      msg:"hello msg"
    }
  },
  methods: {
    switchTab(btnId){
      this.$router.push({name:"/login",params:{id:btnId}})
    }
  },
  created() {
    this.$bus.on("msgMonitor", (payload) => {
      console.log("IM容器消息监听,消息类型===>" ,payload);
    })
  }
}
</script>

<style scoped>


</style>